package com.wh.net.http;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpRequestBase;

/**
 * 用于对HttpClient返回的请求进行处理，下面是一个示例实现：
 * 
 * <pre>
 * class ToStringResposeHandle implements IResponseHandle {
 * 	&#064;Override
 * 	public void process(HttpResponse response, HttpRequestBase post, HttpClient hc) {
 * 		try {
 * 			String result = EntityUtils.toString(response.getEntity());
 * 			System.out.println(&quot;请求返回的结果为：&quot; + result);
 * 		} catch (Throwable e) {
 * 			e.printStackTrace();
 * 		}
 * 	}
 * }
 * </pre>
 * 
 * @author washheart@163.com
 */
public interface IResponseHandle {
	/**
	 * 对返回结果进行处理
	 * 
	 * @param response
	 *            返回结果
	 * @param request
	 *            发送的请求
	 * @param context
	 *            当前的执行环境
	 */
	void process(HttpResponse response, HttpRequestBase request, HttpClient context);
}
